#ifndef _NETWORK_
#define _NETWORK_
#include "client.h"
#include "protocol.h"
#include "errno.h"
// 网络初始化
int init_client_block(ClientContext *ctx, const char *ip, int port);
int init_client_noblock(ClientContext *ctx, const char *ip, int port);

// 数据传输
int send_command(ClientContext *ctx, CommandType_e cmd, const char *data, size_t data_len);

int receive_response(ClientContext *ctx, protocol_header_t *header, char *buf, size_t buf_size);

#endif // _NETWORK_